import org.lwjgl.LWJGLException;
import org.lwjgl.input.Keyboard;


public class InputManager {
	
	InputManager(){
		try {
			Keyboard.create();
		} 
		catch (LWJGLException e) {
			e.printStackTrace();
		}
	}
	//-------------------------------------------------
	public boolean isPressed(String keyName) {
		int key=-1;
		switch (keyName){
			case "W": key = Keyboard.KEY_W; break;
			case "A": key = Keyboard.KEY_A; break;
			case "S": key = Keyboard.KEY_S; break;
			case "D": key = Keyboard.KEY_D; break;
			case "E": key = Keyboard.KEY_E; break;
			case "UP": key = Keyboard.KEY_UP; break;
			case "LEFT": key = Keyboard.KEY_LEFT; break;
			case "DOWN": key = Keyboard.KEY_DOWN; break;
			case "RIGHT": key = Keyboard.KEY_RIGHT; break;
			case "1NUM": key = Keyboard.KEY_NUMPAD1; break;
			case "2NUM": key = Keyboard.KEY_NUMPAD2; break;
		}
		return Keyboard.isKeyDown(key);
	}
}
